home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / O Boy / Source / ComputerAEObj_pd.cp < prev    next >
Text File  |  1996-06-21  |  2KB  |  73 lines

  1. /*
  2.     ComputerAEObj_pd.cp
  3.     © Bob Boylan 1996
  4.  
  5.     Revision History
  6.     MacHack 1996        initial creation
  7. */
  8. #include "ComputerAEObj_pd.h"
  9. #include "ComputerAETE_da.h"
  10. #include "ObjectSpec_da.h"
  11. #include "FinderAppAEObj_pd.h"
  12. #include "ProgressProc_hi.h"
  13.  
  14. //    -----------------------------------------------------------------
  15. //    ctor
  16. //
  17. ComputerAEObj_pd::ComputerAEObj_pd()
  18. {
  19.     // make our own kind of aete
  20.     AETE_da    *theAETE = new ComputerAETE_da;
  21.     _AETE = Clone_ut<AETE_da>( theAETE );
  22.     
  23.     // the app we speak to (the finder)
  24.     _AppSignature = 'MACS';
  25.     
  26.     // create the root object spec
  27.     ObjectSpec_da theRoot;
  28.     theRoot._Name = "";
  29.     theRoot._FormalName = "this Macintosh";
  30.     PushObjSpec( theRoot );
  31. }
  32.  
  33. //    -----------------------------------------------------------------
  34. //    dtor
  35. //
  36. ComputerAEObj_pd::~ComputerAEObj_pd()
  37. {
  38. }
  39.  
  40.  
  41. //    -----------------------------------------------------------------
  42. //    GetObjAddr
  43. //
  44. string
  45. ComputerAEObj_pd::GetObjAddr( vector<ObjectSpec_da>::iterator ioIter )
  46. {
  47.     return (_ObjectSpec.back()).GetSpecAsString();
  48. }
  49.  
  50.  
  51.  
  52. //    -----------------------------------------------------------------
  53. //    GetSubModelCount
  54. //
  55. Int_32
  56. ComputerAEObj_pd::GetSubModelCount(DescType inModelKind)
  57. {
  58. DescType    theRealKind;
  59.  
  60.     // we middle man this one by changing the param along the way
  61.     // ... not a pretty thing, but less intrusive than it could have been
  62.     if( inModelKind == cFinderProcess )
  63.     {
  64.         theRealKind = 'pcap';
  65.     }
  66.     else
  67.     {
  68.         theRealKind = inModelKind;
  69.     }
  70.     
  71.     return AEObj_pd::GetSubModelCount( theRealKind );
  72. }
  73.